//登陆函数 
function login(){
	var url = "adminLoginAction";
	var username = $.trim($("#username").val()); //get user's name
	var password = $.trim($("#password").val()); //get user's password
	var json_user = {
		username : username,
		password : password
	}; 

	if (username == "")
	{
		document.getElementById("error").style.display= "block";
		document.getElementById("error").innerHTML="Please enter your username";
	}else if(password == "") {
		document.getElementById("error").style.display= "block";
		document.getElementById("error").innerHTML="Please enter your password";
	}else{
		$.post( url ,json_user , callback , "json" );

		function callback(json){
			var json_object =eval("("+json+")");
			var suc = json_object.suc;
			if(suc==0 ){
				alert("登陆失败啦!!!");
			}else{
				window.location.href="adminViewBookListAction";
			}
		}
	}
}